<?php
declare(strict_types=1);
/**
 * 商户-购物车页面
 * @author chenshubo
 */
namespace App\Controller\Shop;

use App\Model\PssModel\GoodsCart;
use Hyperf\HttpServer\Contract\RequestInterface;
class CartController extends AbstractController
{
    /**
     * 购物车页面
     */
    public function index(RequestInterface $request) 
    {
        return GoodsCart::instance()->getCartGoodsList($request->getAttribute('param'));
    }

    /**
     * 购物车商品结算
     */
    public function removeCartGoods(RequestInterface $request)
    {
        return GoodsCart::instance()->removeCartGoods($request->getAttribute('param'));
    }
    
    /**
     * 购物车商品结算
     */
    public function orderCartGoods(RequestInterface $request) 
    {
        return GoodsCart::instance()->cartGoodsOrder($request->getAttribute('param'));
    }
    
    /**
     * 购物车商品动态计算
     */
    public function cartGoodsChange(RequestInterface $request) 
    {
        return GoodsCart::instance()->addGoodsCart($request->getAttribute('param'));
    }
    
    /**
     * 计算购物车价格清单
     */
    public function getCardGoodsPriceByCardIds(RequestInterface $request) 
    {
        return GoodsCart::instance()->getCardGoodsPriceByCardIds($request->getAttribute('param'));
    }
}